package com.bocloud.cmp.entity.resource;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 块设备实体类
 * 
 * @author dongkai
 *
 */
@Table("bucket")
public class Bucket extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@IgnoreAll
	private String vendorName; // 云供应商名称
	@Column("region")
	private Long region; // 镜像所在区域
	@IgnoreAll
	private String regionName; // 镜像所在区域名称
	@Column("space")
	private Double space;// 空间
	@Column("location")
	private String location;// 位置
	@Column("acl")
	private Boolean acl;// 权限
	@Column("expired_time")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date expiredTime;// 过期时间
	@Column("region_id")
	private String regionId;

	/**
	 * @return the regionId
	 */
	public String getRegionId() {
		return regionId;
	}

	/**
	 * @param regionId
	 *            the regionId to set
	 */
	public void setRegionId(String regionId) {
		this.regionId = regionId;
	}

	/**
	 * @return the expiredTime
	 */
	public Date getExpiredTime() {
		return expiredTime;
	}

	/**
	 * @param expiredTime
	 *            the expiredTime to set
	 */
	public void setExpiredTime(Date expiredTime) {
		this.expiredTime = expiredTime;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the vendorId
	 */
	public Long getVendorId() {
		return vendorId;
	}

	/**
	 * @param vendorId
	 *            the vendorId to set
	 */
	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	/**
	 * @return the vendorName
	 */
	public String getVendorName() {
		return vendorName;
	}

	/**
	 * @param vendorName
	 *            the vendorName to set
	 */
	public void setVendorName(String vendorName) {
		this.vendorName = vendorName;
	}

	/**
	 * @return the region
	 */
	public Long getRegion() {
		return region;
	}

	/**
	 * @param region
	 *            the region to set
	 */
	public void setRegion(Long region) {
		this.region = region;
	}

	/**
	 * @return the regionName
	 */
	public String getRegionName() {
		return regionName;
	}

	/**
	 * @param regionName
	 *            the regionName to set
	 */
	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	/**
	 * @return the space
	 */
	public Double getSpace() {
		return space;
	}

	/**
	 * @param space
	 *            the space to set
	 */
	public void setSpace(Double space) {
		this.space = space;
	}

	/**
	 * @return the location
	 */
	public String getLocation() {
		return location;
	}

	/**
	 * @param location
	 *            the location to set
	 */
	public void setLocation(String location) {
		this.location = location;
	}

	/**
	 * @return the acl
	 */
	public Boolean getAcl() {
		return acl;
	}

	/**
	 * @param acl
	 *            the acl to set
	 */
	public void setAcl(Boolean acl) {
		this.acl = acl;
	}

	public Bucket() {
		super();
	}

	public Bucket(Long id, String name, Long vendorId, Long region, String remark, String location, Boolean acl,
			Date gmtCreate) {
		super();
		this.id = id;
		this.vendorId = vendorId;
		this.region = region;
		this.location = location;
		this.acl = acl;
		this.setName(name);
		this.setRemark(remark);
		this.setGmtCreate(gmtCreate);
	}

}
